﻿using System;
using System.Windows.Data;

namespace RIBA.VMLocator
{
	public class ViewModelNameToViewModelConverter : IValueConverter
	{
		public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			var locator = (ViewModelLocator)value;
			var index = parameter.ToString(); //ViewModel- Name
			return locator.Find[index];
		}

		public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			throw new NotImplementedException();
		}
	}
}
